package org.geektimes.projects.user.validator.custom;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author :   chuan
 * @date :   2021/03/15
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = UserValidator.class)
public @interface UserValid {

    String message() default "user validate failed";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    int passwordMin() default 6;
    int passwordMax() default 32;

    String emailRegexp() default "";

    String phoneNumberRegexp() default "";
}
